package com.dongfang.dh.positionrecorder;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.location.LocationManager;
import android.os.Bundle;
import android.provider.Settings;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.util.LogUtils;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnClick;

public class MainActivity extends Activity {

	@ViewInject(R.id.activity_main_btn_start)
	private Button btnStart;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		ViewUtils.inject(this);
	}

	@OnClick(R.id.activity_main_btn_start)
	public void onClick(View v) {
		LogUtils.d("---------------------");
		startActivity(new Intent(this, GpsActivity.class));
		return;
//
//		LocationManager alm = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
//		if (alm.isProviderEnabled(android.location.LocationManager.GPS_PROVIDER)) {
//			Toast.makeText(this, "GPS模块正常", Toast.LENGTH_SHORT).show();
//			startActivity(new Intent(this, PositionRecoderActivity.class));
//			return;
//		}
//
//		Toast.makeText(this, "请开启GPS！", Toast.LENGTH_SHORT).show();
//		Intent intent = new Intent(Settings.ACTION_SECURITY_SETTINGS);
//		startActivityForResult(intent, 0); // 此为设置完成后返回到获取界面

	}

}
